﻿using System;
using System.Collections.Generic;
using EnvDTE;
using EnvDTE80;


namespace VsTortoiseSVN.Commands
{
    public class SolutionExplorerSelectedItemsCleanup : SolutionExplorerSelectedItemsBase
    {
        public SolutionExplorerSelectedItemsCleanup(DTE2 application, string name, string caption, string tooltip, int bitmapId)
            : base(application, name, caption, tooltip, bitmapId)
        {
            SupportFile = false;
            SupportFilter = false;
        }

        protected override vsCommandStatus QueryContextSensitiveStatus()
        {
            return vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
        }

        protected override vsCommandStatus  QueryContextInsensitiveStatus()
        {
            return vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
        }

        public override bool Exec()
        {
            List<string> fullNames = GetFullNames();
            TortoiseProc.Cleanup(fullNames);
            return true;
        }
    }
}
